package cn.lngaosu.lwyd.module.integration.dal.mysql.weibostatusesusertimeline;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.weibostatusesusertimeline.WeiboStatusesUsertimelineDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.weibostatusesusertimeline.vo.*;

/**
 * 最新发表的微博列表 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WeiboStatusesUsertimelineMapper extends BaseMapperX<WeiboStatusesUsertimelineDO> {

    default PageResult<WeiboStatusesUsertimelineDO> selectPage(WeiboStatusesUsertimelinePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeiboStatusesUsertimelineDO>()
                .betweenIfPresent(WeiboStatusesUsertimelineDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(WeiboStatusesUsertimelineDO::getSyncDate, reqVO.getSyncDate())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getWeiboId, reqVO.getWeiboId())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getMid, reqVO.getMid())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getText, reqVO.getText())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getSource, reqVO.getSource())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getThumbnailPic, reqVO.getThumbnailPic())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getRepostsCount, reqVO.getRepostsCount())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getCommentsCount, reqVO.getCommentsCount())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getAttitudesCount, reqVO.getAttitudesCount())
                .eqIfPresent(WeiboStatusesUsertimelineDO::getDetailMessage, reqVO.getDetailMessage())
                .orderByDesc(WeiboStatusesUsertimelineDO::getId));
    }

}